<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <f:view contentType="text/html">
        <h:head>
            <f:facet name="first">
                <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
                <title>PrimeFaces</title>
            </f:facet>
            
        </h:head>
        <h:body>
            <h:form prependId="false">
            <p:tabView effect="fade" style="height: 100%;" orientation="left">  
                <p:tab title="Attribute type">  
                    <h:panelGrid> 
                        
                            <p:growl id="messages" showDetail="true"/>
                            <p:dataTable id="tb1" var="att" editable="true" paginator="true" rows="10" value="#{attributebean.attributeTypes}">
                                <p:ajax event="rowEdit" listener="#{attributebean.onEdit}" update="tb1" />
                                <p:ajax event="rowEditCancel" listener="#{attributebean.onCancel}" />
                                <p:column headerText="ID" style="width:25%">
                                    <p:cellEditor>
                                        <f:facet name="output">
                                            <h:outputText value="#{att.id}" />
                                        </f:facet>
                                        <f:facet name="input">
                                            <p:inputText value="#{att.id}" style="width:100%"/>
                                        </f:facet>
                                    </p:cellEditor>
                                </p:column>
                                <p:column headerText="Name" style="width:25%">
                                    <p:cellEditor>
                                        <f:facet name="output">
                                            <h:outputText value="#{att.name}" />
                                        </f:facet>
                                        <f:facet name="input">
                                            <p:inputText value="#{att.name}" style="width:100%"/>
                                        </f:facet>
                                    </p:cellEditor>
                                </p:column>

                                <p:column headerText="Is Number?" style="width:25%">
                                    <p:cellEditor>
                                        <f:facet name="output">
                                            <h:outputText value="#{att.isNumber}" />
                                        </f:facet>
                                        <f:facet name="input">
                                            <h:selectOneMenu value="#{att.isNumber}" >
                                                <f:selectItems value="#{attributebean.flags}"
                                                               var="flag" 
                                                               itemLabel="#{flag}"
                                                               itemValue="#{flag}" />
                                            </h:selectOneMenu>
                                        </f:facet>
                                    </p:cellEditor>
                                </p:column>
                                <p:column style="width:6%">
                                    <p:rowEditor />
                                </p:column>

                                <p:column>
                                    <f:facet name="header">
                                        <h:outputText value="Delete"/>
                                    </f:facet>
                                    <p:growl id="messages" showDetail="true" />

                                    <p:commandButton value="Delete" actionListener="#{attributebean.deleteBean}" update="messages">
                                        <p:confirm header="Confirmation" message="Are you sure?" icon="ui-icon-alert" />
                                    </p:commandButton>
                                    <p:confirmDialog global="true" showEffect="fade" hideEffect="explode">
                                        <p:commandButton value="Yes" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check"/>
                                        <p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close"/> 	
                                    </p:confirmDialog>
                                </p:column>
                            </p:dataTable> 
                       
                    </h:panelGrid>  


                        <h:inputText value="#{attributebean.attributeType.id}" size="10" />
                        &nbsp;&nbsp;

                        <h:inputText value="#{attributebean.attributeType.name}" size="10" />
                        &nbsp;&nbsp;

                        <h:inputText value="#{attributebean.attributeType.isNumber}"  size="10" />

                        <p:commandButton value="Add" icon="ui-icon-script"  actionListener="#{attributebean.addAttributeType}" />  
                   
                </p:tab>  
                <p:tab title="TranService Type">  
                    <h:panelGrid >  
                        <p:dataTable id="tb2" var="att"   value="#{AllTransService.transTypesArr}" paginator="true" rows="10">  
                            <p:column>  
                                <f:facet name="header">  
                                    <h:outputText value="TST NAME" />  
                                </f:facet>  
                                <h:outputText value="#{att.name}" />  
                            </p:column>  

                            <p:column>  
                                <f:facet name="header">  
                                    <h:outputText value="TST ID" />  
                                </f:facet>  
                                <h:outputText value="#{att.id}"/>  
                            </p:column>  

                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Update"/>
                                </f:facet>
                           
                                   
                                  <p:commandButton styleClass="button_example" value="Edit and view" icon="ui-icon-extlink" actionListener="#{AllTransService.viewFun}" />   
 
                            </p:column>

                        </p:dataTable>
                      
                            <p:commandButton styleClass="button_example" value="Add Transportation Service" icon="ui-icon-extlink" actionListener="#{dialogg.viewCarsCustomized()}" />
                        
                        <p:commandButton styleClass="button_example" value="Add TSTA Test" action="index1"/>
                    </h:panelGrid>  
                </p:tab>  
                <p:tab title="TranService">  
                    
                    <p:commandButton value="add" ajax="false" action="transervicewizerd"/>
                    <p:commandButton value="View" ajax="false" action="#{tranServiceBean.sendData()}"/>
                    
                    <h:panelGrid columns="2"  cellpadding="10">  
                        <p:dataTable id="tb3" rowKey="#{ts.id}" value="#{tranServiceBean.tranServices}" var="ts" selectionMode="single" selection="#{tranServiceBean.selectedts}">  
                            <p:column>  
                                <f:facet name="header">  
                                    <h:outputText value="id" />  
                                </f:facet>  
                                <h:outputText value="#{ts.id}" />  
                            </p:column>  

                            <p:column>  
                                <f:facet name="header">  
                                    <h:outputText value="name" />  
                                </f:facet>  
                                <h:outputText value="#{ts.name}"/>  
                            </p:column>  
                            <p:column>  
                                <f:facet name="header">  
                                    <h:outputText value="TST" />  
                                </f:facet>  
                                <h:outputText value="#{ts.tranServiceType.name}" />  
                            </p:column>
                            <p:column>  
                                <f:facet name="header">  
                                    <h:outputText value="T1" />  
                                </f:facet>  
                                <h:outputText value="#{ts.terminalByTerminal1.point.name}" />  
                            </p:column>  
                            <p:column>  
                                <f:facet name="header">  
                                    <h:outputText value="T2" />  
                                </f:facet>  
                                <h:outputText value="#{ts.terminalByTerminal2.point.name}" />  
                            </p:column> 
                              

                        </p:dataTable> 
                    </h:panelGrid>  
                </p:tab>  
                <p:tab title="User">  
                                <h:panelGrid columns="2" cellpadding="10">  
                                   
                                    <p:dataTable value="#{usersBean.users}"
                                                 var="userS" id="tb77" paginator="true" rows="10">  
                                        <p:column>  
                                            <f:facet name="header">  
                                                <h:outputText value="ID" />  
                                            </f:facet>  

                                            <h:outputText value="#{userS.id}" />
                                        </p:column>  

                                        <p:column>  
                                            <f:facet name="header">  
                                                <h:outputText value="Email" />  
                                            </f:facet>  
                                            <h:outputText value="#{userS.email}"/>
                                        </p:column>  

                                        <p:column>  
                                            <f:facet name="header">  
                                                <h:outputText value="Feedback" />  
                                            </f:facet>  
                                            <p:column style="width:4%">
                                                
                                                    <h:commandLink action="#{usersBean.sendData()}" target="_blank">
                                                Show feedback
                                                </h:commandLink>
                                                
                                            </p:column>
                                        </p:column>  
                                    </p:dataTable>  

                                </h:panelGrid>  
                            </p:tab> 
            </p:tabView>  
            </h:form>
        </h:body>

    </f:view>
</html>

